<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
        <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
        <title>随手快递</title>
        <link rel="stylesheet" type="text/css" href="../../AUI/css/aui.css" />
        <link rel="stylesheet" type="text/css" href="../../font-awesome/css/font-awesome.min.css" />
        <style type="text/css">
            .aui-content {
                margin: 35px 10px;
                padding: 10px 0;
                text-align: center;
            }
            td{ width:180px; height:25px;}
            .num {
            }
            p {
            	text-align: center;
            	margin: 20px auto;
            }
            #pay {
            	margin: 10px auto;
            }
            .aui-list.aui-list-in .aui-list-item {
                background-position: 0rem bottom;
            }
            .aui-list-item-title{
                font-size: 14px !important;
            }
            .aui-list-item-inner .aui-list-item-right{
                color: #242424;
            }
        </style>
    </head>
    <body style="overflow-x: hidden;background: #fff">
         <header class="aui-bar aui-bar-nav" id="aui-header">
            <a class="aui-btn aui-pull-left" tapmode onclick="back()">
                <span class="aui-iconfont aui-icon-left"></span>
            </a>
            <div class="aui-title">支付</div>
            <div class="aui-btn aui-pull-right"></div>
        </header>
         <div class="aui-content aui-margin-b-15">
             <ul class="aui-list aui-list-in">
               <!--   <li class="aui-list-item" id="esp">
                     <div class="aui-list-item-inner">
                         <div class="aui-list-item-title">商品金额</div>
                         <div class="aui-list-item-right" id="estimateThePrice"></div>
                     </div>
                 </li>
                 <li class="aui-list-item" id="rew">
                     <div class="aui-list-item-inner">
                         <div class="aui-list-item-title">小费</div>
                         <div class="aui-list-item-right" id="reward"></div>
                     </div>
                 </li> -->
                 <li class="aui-list-item">
                     <div class="aui-list-item-inner">
                         <div class="aui-list-item-title">快递费</div>
                         <div class="aui-list-item-right" id="courierFees"></div>
                     </div>
                 </li>
                 <li class="aui-list-item">
                     <div class="aui-list-item-inner aui-list-item-arrow" onclick="location.href='voucher.html'">
                         <div class="aui-list-item-title">代金券</div>
                         <div class="aui-list-item-right" id="vouchersPrice" style="color:#fb6506;"></div>
                     </div>
                 </li>
                 </ul>
             <div class="aui-card-list-content-padded " id="totle" style="height: 42px;margin-top: 6px">
                 <div style="font-size: 15px;font-weight: bold;" class="aui-pull-right">
                     <span id="acount"></span>
                 </div>
             </div>

         </div>
         <div style="left:15px;bottom:340px;position: fixed;width: 100%">
             <label>选择支付方式</label>
             <img src="../../myImage/pay1.png" style="margin-left: -15px">

         </div>
         <div onclick="pay()" class="aui-btn aui-btn-success" style="position: fixed;left:5%;bottom:0px;width:90%;height: 33px;line-height: 33px;background: rgb(37, 161, 149)" id="pay">支付</div>

         <script src="../../myJs/jquery.js"></script>
         <script src="../../myJs/jquery.cookie.js"></script>
         <script>
            /*  var data={
                 "code": 95158,
                 "msg":
                     {
                         "status":0,
                         "reward": "10元",
                         "estimateThePrice": "13元",
                         "courierFees": "5元",
                         "vouchersPrice": "5元",
                         "account":"23元"
                     }

             } */
             var status = sessionStorage.getItem("status");;
             var orderId = sessionStorage.getItem("orderId");
         $(function() {
          $.ajax({
         type: "post",
         url: '/randomdelivery/userPurchaseController/payCourierPricePage',
         data: {orderId:orderId },
         datatype: "json",
         success: function (data) {
        	 alert(JSON.stringify(data));
        	 viewPay(data);
         }
         });
         //viewPay(data);
         })

         function viewPay(data){
            var data = data.msg;
            // status = data.status;
            (data.vouchersPrice==null?$("#vouchersPrice").html("去选择"):$("#vouchersPrice").html("-"+data.vouchersPrice+"元"));
            
             $("#courierFees").html(data.courierFees);
             $("#acount").html("合计："+data.account+"元");
          
         }
             function back(){
               alert(1);
             }
             function pay(){
            	 location.href='receivedOrder.html';
                	  $.ajax({
                	         type: "post",
                	         url: '/randomdelivery/userPurchaseController/payCourierPrice',
                	         data: {orderId:orderId },
                	         datatype: "json",
                	         success: function (data) {
                	        	 alert(JSON.stringify(data));
                	        	 location.href='receivedOrder.html';
                	         }
                	         });
                     
                 
             }
         </script>
        </body>
    </html>